<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>prototype</title>
</head>
<script>
    function People(name) {
        this.name = name;
        this.introduce = function () {
            console.log(`我叫 ${this.name}`);
        }
    }

    function People2(name) {
        this.name = name;
        this.introduce = function () {
            console.log(`我叫 ${this.name}`);
        }
    }

    People2.run = function () {
        console.log('我能跑');
    }


    function People3(name) {
        this.name = name;
    }
    
    People3.prototype.introduce = function () {
        console.log(`我叫 ${this.name}`);
    }

    People3.prototype.introduceChinese = function () {
        console.log("我的名字是" + this.name);
    }

    console.log(People);
    console.log(People2);
    console.log(People3);

    var p1 = new People('张三');
    var p2 = new People2('李四');
    var p3 = new People3('王五');
    console.log(p1);
    console.log(p2);
    console.log(p3);
</script>

<body>

</body>

</html>